﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SIA.Allarms;
using SIA.Configurators;
using System.Data;

namespace SIA.DataBase
{
    public abstract class DBArchive : IDBArchive 
    {
        protected String _sqlConString = "";
        protected String _storicAllarmsTable = "";

        public string SqlConString{ get { return _sqlConString;} set { _sqlConString=value;}}
        public string StoricAllarmsTable{ get { return _storicAllarmsTable;} set { _storicAllarmsTable=value;}}

        /// <summary>Costruttore </summary>
        /// <param name="DBProperty">"SQLCONSTRING","STORICALLARMSTABLE"</param>
        public DBArchive (IDictionaryProperty DBProperty)
	    {
            _sqlConString = DBProperty["CONNECTIONSTRING"].PropertyValue;
            _storicAllarmsTable = DBProperty["STORICALLARMSTABLE"].PropertyValue;
	    }

        abstract public void savePastAllarm(IAllarm allarme);

        abstract public DataTable Select(String selectQuery);
    }
}
